﻿namespace Landpy.CruiseControlNet.ConfigurationSidekick.ConfigPropertyModule
{
    static class TreeNodeProcessChain
    {
        public static IGetPropertiesHandler GetChain()
        {
            IGetPropertiesHandler cruiseControlHandler = new CruiseControlHandler();
            IGetPropertiesHandler internalSecurityHandler = new InternalSecurityHandler();
            IGetPropertiesHandler securityUserHandler = new InternalSecurityUserHandler();
            IGetPropertiesHandler permissionHandler = new PermissionHandler();
            IGetPropertiesHandler projectHandler = new ProjectHandler();
            IGetPropertiesHandler projectSecurityHandler = new ProjectSecurityHandler();
            IGetPropertiesHandler rolePermissonSecurityUserHandler = new RolePermissonSecurityUserHandler();
            IGetPropertiesHandler sourceControlHandler = new SourceControlHandler();
            IGetPropertiesHandler triggerHandler = new TriggerHandler();
            IGetPropertiesHandler taskHandler = new TaskHandler();
            IGetPropertiesHandler assemblyHanlder = new AssemblyHandler();
            IGetPropertiesHandler publisherHandler = new PublisherHandler();
            IGetPropertiesHandler emailUserHandler = new EmailUserHandler();
            IGetPropertiesHandler emailGroupHandler = new EmailGroupHandler();
            IGetPropertiesHandler subjectTypeHandler = new SubjectHandler();
            IGetPropertiesHandler xslFileHandler = new XslFileHandler();
            IGetPropertiesHandler unknowHandler = new UnknowHandler();
            cruiseControlHandler.Successor = internalSecurityHandler;
            internalSecurityHandler.Successor = securityUserHandler;
            securityUserHandler.Successor = permissionHandler;
            permissionHandler.Successor = projectHandler;
            projectHandler.Successor = projectSecurityHandler;
            projectSecurityHandler.Successor = rolePermissonSecurityUserHandler;
            rolePermissonSecurityUserHandler.Successor = sourceControlHandler;
            sourceControlHandler.Successor = triggerHandler;
            triggerHandler.Successor = taskHandler;
            taskHandler.Successor = assemblyHanlder;
            assemblyHanlder.Successor = publisherHandler;
            publisherHandler.Successor = emailUserHandler;
            emailUserHandler.Successor = emailGroupHandler;
            emailGroupHandler.Successor = subjectTypeHandler;
            subjectTypeHandler.Successor = xslFileHandler;
            xslFileHandler.Successor = unknowHandler;
            return cruiseControlHandler;
        }
    }
}
